<?php
	header("Content-type:text/html;charset=utf-8");    //设置编码

	$servername = "localhost";
	$username = "hotel";
	$password = "vw8jj2";
	$dbname = "consult";
	// 创建连接
	$conn = new mysqli($servername, $username, $password , $dbname , 3308);
	 
	// 检测连接
	if ($conn->connect_error) {
	    die("连接失败: " . $conn->connect_error);
	} 
	echo "连接成功";


	// 使用 sql 创建数据表
	$sql = "CREATE TABLE  liuyan ( 
    	id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    	user_name varchar(100) NOT NULL,
    	content varchar(100) NOT NULL,
    	createtime varchar(100) NOT NULL
	)";

	if ($conn->query($sql) === TRUE) {
	    echo "数据表创建成功";
	} else {
	    echo "创建数据表错误: " . $conn->error;
	}

/*	$sql1 = "INSERT INTO juice (title,price,num)
VALUES ('咖啡', '18', '1');";
$sql1 .= "INSERT INTO juice (title,price,num)
VALUES ('咖啡', '18', '1');";
$sql1 .= "INSERT INTO juice (title,price,num)
VALUES ('咖啡', '18', '1');";
$sql1 .= "INSERT INTO juice (title,price,num)
VALUES ('咖啡', '18', '1');";
$sql1 .= "INSERT INTO juice (title,price,num)
VALUES ('咖啡', '18', '1');";
$sql1 .= "INSERT INTO juice (title,price,num)
VALUES ('咖啡', '18', '1');";
$sql1 .= "INSERT INTO juice (title,price,num)
VALUES ('咖啡', '18', '1');";
$sql1 .= "INSERT INTO juice (title,price,num)
VALUES ('咖啡', '18', '1');";
$sql1 .= "INSERT INTO juice (title,price,num)
VALUES ('咖啡', '18', '1');";



 
if (mysqli_multi_query($conn, $sql1)) {
    echo "新记录插入成功";
} else {
    echo "Error: " . $sql1 . "<br>" . mysqli_error($conn);
}*/
mysqli_close($conn);
?>
